//
//  XS_PrivacySetVC.swift
//  XueDao
//
//  Created by Mac on 2020/12/12.
//

import UIKit

class XS_PrivacySetVC: XS_BaseVC {

    @IBOutlet weak var tableView: UITableView!
    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        view.backgroundColor = #colorLiteral(red: 0.968627451, green: 0.968627451, blue: 0.968627451, alpha: 1)
        title = "隐私设置"
        tableView.contentInset = UIEdgeInsets.init(top: 0, left: 0, bottom: .bottomHeight, right: 0)
        tableView.register(UINib.init(nibName: "XS_SetListCell", bundle: Bundle.main), forCellReuseIdentifier: "XS_SetListCell")
        tableView.delegate = self
        tableView.dataSource = self
    }


    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */
    
    @objc func cellarSwitchAction(sender: UISwitch){
        
    }

}

extension XS_PrivacySetVC : UITableViewDelegate,UITableViewDataSource{
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return 1
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: "XS_SetListCell", for: indexPath) as! XS_SetListCell
        cell.nextImageView.isHidden = true
        cell.titleLabel.text = "个性化服务"
        cell.rightLabel.text = ""
        cell.cellarSwitch.isHidden = false
        cell.rightNextLabel.text = ""
        cell.cellarSwitch.addTarget(self, action: #selector(cellarSwitchAction(sender:)), for: .valueChanged)
        return cell
    }
    
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return 50
    }
}
